package cz.ctu.android.DriveCommunicator.activities;

import cz.ctu.android.DriveCommunicator.R;
import cz.ctu.android.DriveCommunicator.utils.DriverConstants;
import cz.ctu.android.DriveCommunicator.utils.ImageMapper;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.TextView;

public class ReceiverConfirmActivity extends  Activity{
	
	
	private OnClickListener backClickListener=new OnClickListener(){

		public void onClick(View v) {
			Intent intent=new Intent(ReceiverConfirmActivity.this,NewMessageActivity.class);
	        startActivity(intent);
	        
		}
    	
    };
    
    private OnClickListener confirmClickListener=new OnClickListener(){

		public void onClick(View v) {
			Intent intent=new Intent(ReceiverConfirmActivity.this,ReplyKeyboardActivity.class);
			intent.putExtras(bundle);
	        startActivity(intent);       
		}
    	
    };
    
    private ImageButton backButton;
	private ImageButton confirmButton;
	private Bundle bundle;
    
    protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.receiver_confirm);
	    bundle = this.getIntent().getExtras();
		int id=bundle.getInt("idToLoad");
		
		backButton = (ImageButton)findViewById(R.id.imageButton1);
		backButton.setOnClickListener(backClickListener);
		backButton.setImageResource(ImageMapper.getImage(id));
		confirmButton = (ImageButton)findViewById(R.id.imageButton2);
		confirmButton.setOnClickListener(confirmClickListener);
		
		TextView text = (TextView) findViewById(R.id.textView1);
		text.setText(DriverConstants.Users.getUserByID(id).getJmeno()+" "+DriverConstants.Users.getUserByID(id).getPrijmeni());
		
	}
}
